# -*- coding: utf-8 -*-
"""
 @Time    : 2021/1/29 下午2:43
 @Author  : tgy
 
"""
from functools import partial
import io
import os

def read(file_path,size = 1024):
    ...
    with open(file_path,mode='rt',encoding='utf-8') as f:
        ...
        for content in iter(partial(f.read,size),''):
            ...
            print(content)


class MyStringIO:

    def __init__(self):
        self.content = []


    def write(self,content):
        self.content.append(content)

    def getValue(self):
        return ''.join(self.content)


def write_mem():
    ...
    # s = io.StringIO()
    s = MyStringIO()
    datas = [1,read,(3,4)]
    print(*datas,sep=',', end='',file=s)
    print(s.getValue())


if __name__ == '__main__':
    ...
    # read('./大纲.md',size=10)
    write_mem()
